package com.showgood;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextHolder {
	private ApplicationContext context;
	
	public ApplicationContext getContext() {
		return context;
	}
	
	private ApplicationContextHolder() {
		String[] beansConfig = new String[]{"service.xml"};
		context = new ClassPathXmlApplicationContext(beansConfig);
	}
	
	private static ApplicationContextHolder instance;
	
	public static ApplicationContextHolder getInstance() {
		if (instance == null) {
			instance = new ApplicationContextHolder();
		}
		return instance;
	}
}
